package classfile

type LineNumberTableAttribute struct {
	attribute_name_index     uint16
	attribute_length         uint32
	line_number_table_length uint16
	lineNumberTable          []*LineNumberTableEntry
}

type LineNumberTableEntry struct {
	startPc    uint16
	lineNumber uint16
}

func (self *LineNumberTableAttribute) readInfo(reader *ClassReader) {
	//self.attribute_name_index = reader.readUint16()
	self.line_number_table_length = reader.readUint16()
	self.lineNumberTable = make([]*LineNumberTableEntry, self.line_number_table_length)
	for i := range self.lineNumberTable {
		self.lineNumberTable[i] = &LineNumberTableEntry{
			startPc:    reader.readUint16(),
			lineNumber: reader.readUint16(),
		}
	}
}
